<div class="container" @myInsertRemoveTrigger *ngIf="change" [hidden]="!hide" draggable="true">
  <div class="top">
    <div><i></i><label>审批</label></div>
    <span class="spanOne" (click)="close()"><i class="iconfont icon-guanbi"></i></span>
    <span class="spanThree" (click)="toSmall($event)"><i class="iconfont icon-suoxiao"></i></span>
  </div>
  <div clcas="bottom">
    <div class="operation">
      <button class="btn-default" (click)="changeApproved(null)">所有</button>
      <button class="btn-default1" (click)="changeApproved(0)">待审批</button>
      <button class="btn-default2" (click)="changeApproved(2)">已审批</button>
      <button class="btn-default3" (click)="changeApproved(1)">未通过</button>
      <div class="search">
        <input type="text" [(ngModel)]="keyword"><button class="btn-search" (click)="select()">搜索</button>
      </div>
    </div>
    <table class="table">
      <thead>
        <tr>
          <th>编号</th>
          <th>申请人</th>
          <th>申请时间</th>
          <th>申请类型</th>
          <th>申请内容</th>
          <th>审批人</th>
          <th>状态</th>
          <th>操作</th>
        </tr>
      </thead>
      <tbody>
        <tr *ngFor="let item of data; let i = index">
          <td>{{ i + 1 }}</td>
          <td>{{ item.id.name }}</td>
          <td>{{ item.time }}</td>
          <td>{{ item.applicant }}</td>
          <td>{{ item.content }}</td>
          <td>{{ item.sign }}</td>
          <td>
            <span class="orange" [ngClass]="{
                  'btn-orange': item.state == 0,
                  'btn-red': item.state == 1,
                  'btn-green': item.state == 2
                }">{{
                  item.state == 0
                    ? "待审批"
                    : item.state == 1
                    ? "未通过"
                    : "已审批"
                }}</span>
          </td>
          <td>
            <button [ngClass]="{ 'btn-btn': item.state != 0 }" (click)="success(i)">
              通过
            </button>
            <button [ngClass]="{ 'btn-btn': item.state != 0 }" (click)="fail(i)">
              驳回
            </button>
          </td>
        </tr>
      </tbody>
    </table>
  </div>
</div>
